//
//  SHSingleton.m
//  SDemo
//
//  Created by gg on 2018/7/16.
//  Copyright © 2018年 gg. All rights reserved.
//

#import "SHSingleton.h"

@implementation SHSingleton

static SHSingleton *_instance = nil;

//应该是最保险的写法
+ (instancetype)share{
    static  dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _instance = [[super allocWithZone:NULL] init];
    });
    return _instance;
}

+(instancetype)allocWithZone:(struct _NSZone *)zone {
    return [SHSingleton share];
}

-(id) copyWithZone:(struct _NSZone *)zone{
    return [SHSingleton share];
}

@end
